import {BASE_URL} from "./urls.js"
export const request = (params)=>{

	return new Promise(function(resolve,reject){
		uni.showLoading({
			mask:true,
			title:"正在加载中。。。"
		})
		uni.request({
			...params,
			url: BASE_URL+ params.url,
			success:(res)=>{
				resolve(res.data);
			},
			fail:(err)=>{
				reject(err);
			},
			complete: () => {
				uni.hideLoading();
			}
		})
	})
}
